<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@include file="../../include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="../../include/inhead.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
<meta name="keywords" content="E爱车 洗车 到店洗车" />
<meta name="description" content="E爱车" />
<link rel="shortcut icon" href="${ctx}/static/imges/favicon.ico" />
<title>E爱车服務商後台</title>
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/autoinn/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/autoinn/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/autoinn/slideNav.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/css/autoinn/washCar.css" />
	<style type="text/css">
		body {
			background-color: #f0efed;
		}
		.container {
			padding-left: 0px;
			padding-right: 0px;
		}
		.row {
			margin-left: 0px;
			margin-right: 0px;
		}
		.list-group-item:first-child {
			border-top-left-radius: 0px;
			border-top-right-radius: 0px;
		}
		.list-group-item:last-child {
			border-bottom-right-radius: 0px;
			border-bottom-left-radius: 0px;
		}
		.active a {
			color: #EF8A55;
		}
		a:hover {
			color: #919191;
			text-decoration: none;
		}
		.list-group-item:first-child {
			border-top-left-radius: 4px;
			border-top-right-radius: 4px;
		}
		.list-group-item:last-child {
			border-bottom-right-radius: 4px;
			border-bottom-left-radius: 4px;
		}
	</style>
	<script type="text/javascript" src="${ctx}/static/js/autoinn/jquery/jquery-1.7.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/autoinn/bootstrap/bootstrap.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/convertor.js"></script>
	</head>

	<body>
		<div class="container">

			<div class="orange-orange-a row pf text-center border-1 bdc-e6e6e6 bgc-f8f8f8 pt-5 pb-5 z99 w h45 " style="left: 0; top: 0;">
				<div class="col-xs-4 line-height-35 text-left pl-15 pr-0 pt-0">
					<a class="go-back f15 pa z99 pointer co8" style="left: 15px;">
						<i class="fa f20 fa-angle-left pr-3"></i>返回
					</a>
				</div>
				<div class="col-xs-4 line-height-35 f18 pr-0 pl-0 text-center">洗车订单列表</div>
			
						<div class="cate-nav bgc-ffffff mt-0 pl-0 pr-0 col-xs-12 row  text-left" style="background-color: #f8f8f8">
			 
				  <div class="input-group">
				   	 <input type="text"  id="sou" class="form-control" id="s_company_name" name="s_company_name" placeholder="请输入手机号,如:"  >
				 	 <span class="input-group-addon bgc-EF8A55 co5" id="s_schear" onclick="return search();">搜索</span>
		</div>
				
				</div>
			

			</div>
			
			<div class="row pt-100 pb-50 car-wash-list">
				<div class="pop-shade nav-hide"></div>
			
					<div class="alert alert-info mr-5 ml-5" id="loding_msg" style="margin-top:40px">正在定位中...</div>
				<div class="col-xs-12 pb-15 nav-hide get-more-div">
					<button class="btn btn-lg btn-default btn-block co3 get-more" data-page_index="0">查看更多...</button>
				</div>
			</div>

			
		</div>
		<input type="hidden" id="shou" value="${shou }"/>
		<script type="text/javascript">
            var PARENT_URL ='',
            	ERROR_MSG = '',
                SUCCESS_MSG = '',
                INFO_MSG = '',
                WARNING_MSG = '';
        </script>

	    <script type="text/javascript" src="${ctx}/static/js/autoinn/jquery/jquery.placeholder.js"></script>
		<script type="text/javascript" src="${ctx}/static/js/autoinn/common.js"></script>
		<script type="text/javascript" src="${ctx}/static/js/autoinn/washCar.js"></script>
		<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/autoinn/slideNav.js"></script>
		<script type="text/javascript">
		//隐藏微信分享按钮
		document.addEventListener("WeixinJSBridgeReady",
				function onBridgeReady(){
					WeixinJSBridge.call("hideOptionMenu")
				}
		);
		
	
		$(function(){
			getData();
		});
		var sou = $.Global.Utils.getQueryString("sou");
		
	    if(sou==null){
	       sou="";
	    }
		
		function search(){
			var sou = $("#sou").val();
			if(sou==""){
				alert("请填写电话号码!");
				return false;
			}
			window.location.href=ctx+"/moblile/index/auindex?sou="+sou;
			return true;
		}
		  $('.get-more').bind('click', function(){
		    	getData();
		 });
		function getData(){
			$('#loding_msg').html("正在拼命为您获取数据中");
			 var me =  $('.get-more'),
	            pageIndex = parseInt(me.data('page_index')),
	            strHtml = [
	                   	'<ul class="list-group col-xs-12  pl-15 pr-15" style="margin-top:1px">',
							'<li class="list-group-item row pl-0 pr-0 pr">',
							
									'<div class="col-xs-12  pr-100  mb-10">',
										'<div class="fb f15 co7">{1}</div>',	
										'</div>',
									'</div>',
							
								'<div class="bgc-ffffff mt-0 row">',
								   '<div class="pt-10 pr col-xs-12 pl-0 border-top bdc-e6e6e6 f14">',
								    
									      '<span class="pl-25">{6}</span>',
								    
							       '</div>',
							       
								'</div>',
								'<div class="pt-10 pr col-xs-12 pl-0 border-top bdc-e6e6e6 f14">',
								
								'<div class="pl-25 pr-15 co7 text-center" style="word-break: break-all">消费时间 : {2}</div>',
						
							   '</div>',
								
			
								
							   
								'<div  class="pt-10 pb-5 pr col-xs-6 pl-0 f14 text-center border-top border-right bdc-e6e6e6">',
								
								'<div class="pl-25 pr-15 co7 text-center" >{5}</div>',
								
							   '</div>',
							   '<div class="pt-10 pb-5 pr col-xs-6 pl-0 f14 text-center border-top bdc-e6e6e6">',
							     '<span class="pl-25 pr-15 co7 text-center" >状态：{4}</span>',
						   '</div>',

							'<div  class="pt-10 pb-5 pr col-xs-6 pl-0 f14 text-center border-top border-right bdc-e6e6e6">',
							
							'<div class="pl-25 pr-15 co7 text-center" >应付金额:{7}元</div>',
							
						   '</div>',
						   '<div class="pt-10 pb-5 pr col-xs-6 pl-0 f14 text-center border-top bdc-e6e6e6">',
						     '<span class="pl-25 pr-15 co7 text-center" >实际金额：{8}元</span>',
					   '</div>',
										'<div class="pt-10 pr col-xs-12 pl-0 border-top bdc-e6e6e6 f14">',											
											'<div class="pl-25 pr-15 co7" style="word-break: break-all">备注:{3}</div>',
										'</div>',
								'</div>',
							'</li>',
						'</ul>'
	            ].join('');
	       		g_ajax_processing_obj_id = $('.get-more').setUUID().attr('id');
	       		ajaxSend(ctx+"/moblile/index/aulist",
				         {"pageNum": pageIndex + 1,
			    		  "sou"  : sou
			    		  }, 
				          function(data){
			    			    if(data.success){
			    			    	
			    			    	$('#loding_msg').hide();
			    			    	 if(data.rows!=null && data.rows.length > 0){
						                    var str = "";
						                    var st = "";
						                     $.map(data.rows, function(d){
						                    	 if(d.state==0){
						                    		 st="未消费";
						                    	 }else{
						                    		 st="已消费";
						                    	 }
                                                   	var sd = d.yfprice;
                                                   	if(sd<0){
                                                      sd=0;
                                                   	}
						                        str += String.format(
						                            strHtml,
						                            d.id,
						                            d.nickname, 
						                            d.innertime, 
						                            d.des,
						                            st,
						                            d.phoneNum,
						                            d.proname,
						                            d.price,
						                           sd

						                        
						                        );
						                    }); 
						                    $(str).insertBefore(me.parent());
						                    me.data("page_index", pageIndex + 1);
						                    
						                    if(data.total>(pageIndex + 1)*5){
						                    	$(".get-more-div").show();
						                    }else{
						                    	$(".get-more-div").hide();
						                    }
						                    
						              }else{
						            	  $('#loding_msg').hide();
						            	  str= '<div class="blank10"></div><div class="alert alert-info mr-5 ml-5">暂无数据信息！</div>';
					    			      $(str).insertBefore(me.parent());
					    			     $(".get-more-div").hide();
						              }
			    			    }else {
			    			    	$('#loding_msg').hide();
			    			    	str= '<div class="blank10"></div><div class="alert alert-info mr-5 ml-5">获取数据出现错误</div>';
			    			    	$(str).insertBefore(me.parent());
			    			    	$(".get-more-div").hide();
				                }
				            }
				   ); 
		}
			
	
	
			
	</script>
		
	</body>
</html>